package com.yanqu.road.server.cmd.match;

import com.yanqu.road.pb.variety.VarietyProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.match.MatchModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

/**
 * @author ：zfr
 * @date ：2021/2/7 10:35
 */
@Cmd(code = GameProtocol.S_VARIETY_DISPATCH_TEAM_FROM_CROSS, desc = "跨服派遣返回")
public class DispatchTeamFromCrossCmd extends AbstractCommand {
    VarietyProto.DispatchTeamCrossRespMsg msg;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        msg = VarietyProto.DispatchTeamCrossRespMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        player.getModule(MatchModule.class).dispatchTeamFromCross(msg.getId(), msg.getLevel(), msg.getMatchId(), msg.getPatronsIdList(), msg.getRet());
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
